<?php
// cookies; clear cookies upon successful transaction
if( isset( $_GET[ "dc" ] ) && !empty( $_GET[ "dc" ] ) ) {
	$dc_val = stripslashes( strip_tags( $_GET[ "dc" ] ) );
	if( $dc_val == "pp" ) {
		if( $_COOKIE[ "sofasuppastore" ] ) {
			foreach( $_COOKIE[ "sofasuppastore" ] as $name => $value ) {
				setcookie( "sofasuppastore[$name]", "", time()-36000, "/" );
			}
		}
	}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>

<!-- head start -->

<head profile="http://gmpg.org/xfn/11">
	<?php
    $aOptions = SofaSuppaStore::initOptions( false );
	$hp_layout = $aOptions[ 'hp_layout' ];
    $usebread = $aOptions[ 'usebread' ];
    $useslider = $aOptions[ 'useslider' ];
	$slidertype = $aOptions[ 'slidertype' ];
	// slider
	$sstiming = ( strlen( $aOptions[ 'sstiming' ] ) > 0 ) ? floatval( $aOptions[ 'sstiming' ] ) : 3;
	$ssmode = $aOptions[ 'ssmode' ];
	$sseff = $aOptions[ 'sseff' ];
	$ssslices = ( strlen( $aOptions[ 'ssslices' ] ) > 0 ) ? intval( $aOptions[ 'ssslices' ] ) : 10;
	$ssboxCols = ( strlen( $aOptions[ 'ssboxCols' ] ) > 0 ) ? intval( $aOptions[ 'ssboxCols' ] ) : 8;
	$ssboxRows = ( strlen( $aOptions[ 'ssboxRows' ] ) > 0 ) ? intval( $aOptions[ 'ssboxRows' ] ) : 4;
	$ssanimSpeed = ( strlen( $aOptions[ 'ssanimSpeed' ] ) > 0 ) ? floatval( $aOptions[ 'ssanimSpeed' ] ) : 0.4;
	$ssprevText = ( strlen( $aOptions[ 'ssprevText' ] ) > 0 ) ? $aOptions[ 'ssprevText' ] : 'Previous Slide';
	$ssnextText = ( strlen( $aOptions[ 'ssnextText' ] ) > 0 ) ? $aOptions[ 'ssnextText' ] : 'Next Slide';
	$entrycurrency = $aOptions[ 'entrycurrency' ];
	$use_stock = $aOptions[ 'use_stock' ];
	// colorbox
	$cb_width = ( strlen( $aOptions[ 'cb_width' ] ) > 0 ) ? intval( $aOptions[ 'cb_width' ] ) : 720;
	$cb_height = ( strlen( $aOptions[ 'cb_height' ] ) > 0 ) ? intval( $aOptions[ 'cb_height' ] ) : 480;
	$cb_height_small = ( strlen( $aOptions[ 'cb_height_small' ] ) > 0 ) ? intval( $aOptions[ 'cb_height_small' ] ) : 320;
	// slider
	$sli_ty = isset( $_GET[ 'slider' ] ) ? strip_tags( stripslashes( $_GET[ 'slider' ] ) ) : 'jq';
	
	// handle font selection
	$google_fonts = $aOptions[ 'google_fonts' ];
	$font_str = $google_fonts;
	$font_str_arr = explode( ':', $font_str );
	$font_name = $font_str_arr[ 0 ];
	$clean_font_arr = explode( '+', $font_name );
	$clean_font_name = implode( ' ', $clean_font_arr );
    ?>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>
	<?php
	global $page, $paged;
	wp_title( '|', true, 'right' );
	bloginfo( 'name' );
	// Add the blog description for the home/front page.
	$site_description = get_bloginfo( 'description', 'display' );
	if ( $site_description && ( is_home() || is_front_page() ) ) echo " | $site_description";
	// Add a page number if necessary:
	if ( $paged >= 2 || $page >= 2 ) echo ' | ' . sprintf( __( 'Page %s', 'sofa_suppastore' ), max( $paged, $page ) );
	?>
    </title>
	<meta name="description" content="<?php bloginfo( 'description' ); ?>" />
	<meta name="keywords" content="<?php bloginfo( 'name' ); ?>" />
	<meta name="author" content="<?php bloginfo( 'name' ); ?>" />
    <link href='http://fonts.googleapis.com/css?family=<?php echo $google_fonts; ?>' rel='stylesheet' type='text/css' />
    <link rel="stylesheet" href="<?php echo( get_template_directory_uri() . '/960.css' ); ?>" type="text/css" media="screen, projection" />
    <link rel="stylesheet" href="<?php echo( get_template_directory_uri() . '/screen.css' ); ?>" type="text/css" media="screen, projection" />
    <style type="text/css">
	/* handle basic styles according to google fonts selection */
	h1, h2, h3, h4, h5, h6 { font-family: '<?php echo $clean_font_name; ?>', Arial, sans-serif; font-weight: normal; }
	</style>
	<link rel="stylesheet" href="<?php bloginfo( 'stylesheet_url' ); ?>" type="text/css" media="screen, projection" />
    <?php if( $sli_ty == 'jq' ) { ?>
    <link rel="stylesheet" href="<?php echo( get_template_directory_uri() . '/script/styles/nivo-slider.css' ); ?>" type="text/css" media="screen, projection" />
    <?php } ?>
    <!--[if IE 7]>
    <link rel="stylesheet" href="<?php echo( get_template_directory_uri() . '/IE7_style.css' ); ?>" type="text/css" media="screen, projection" />
    <![endif]-->
    
    <!--[if IE 9]>
    <link rel="stylesheet" href="<?php echo( get_template_directory_uri() . '/IE9_style.css' ); ?>" type="text/css" media="screen, projection" />
    <![endif]-->
    
    <?php wp_print_scripts( 'jquery' ); ?>
    
    <?php if( $useslider == 'yes' && ( is_home() || is_page_template( 'index_full_products.php' ) || is_page_template( 'index_narrow_scrolled.php' ) || is_page_template( 'index_narrow_grided.php' ) || is_page_template( 'index_common_blog.php' ) ) ) { ?>
    	<?php if( $sli_ty == 'jq' ) { ?>
    	<script src="<?php echo( get_template_directory_uri() . '/script/jquery.nivo.slider.pack.js' ); ?>" type="text/javascript"></script>
        <?php } elseif( $sli_ty == 'pm' ) { ?>
        <script type="text/javascript" src="<?php echo( get_template_directory_uri() . '/script/piecemaker/scripts/swfobject/swfobject.js' ); ?>"></script>
        <?php } ?>
    <?php } ?>
    <script src="<?php echo( get_template_directory_uri() . '/script/jquery.tools.min.js' ); ?>" type="text/javascript"></script>
    <script src="<?php echo( get_template_directory_uri() . '/script/dropmenu.js' ); ?>" type="text/javascript"></script>

	<script type='text/javascript'>
		jQuery( document ).ready( function() {
			// html element background
			var body_bg_color = jQuery( "body" ).css( 'background-color' );
			jQuery( "html" ).css( "background-color", body_bg_color );
			// drop-down menu | dropmenu.js
    		jQuery( "#dropmenu ul" ).css( { display: "none" } ); // Opera Fix
    		jQuery( "#dropmenu li" ).hover( function() {
    				jQuery( this ).find( 'ul:first' ).css( { visibility: "visible", display: "block" } ).show();
    				}, function() {
    				jQuery( this ).find( 'ul:first' ).css( { visibility: "hidden", display: "none" } ).hide();
    		} );
			
			// scroll to top
			jQuery( '#totop' ).click( function() {
				var bodyelem = '';
				if( jQuery.browser.safari ) bodyelem = jQuery( 'body' ); // only Opera specific
				else bodyelem = jQuery( 'html' );
				jQuery( bodyelem ).animate( { scrollTop: jQuery( '#maincontainer' ).offset().top }, 'slow' );
				return false;
			} );
			
			// submenus
			var time_on = 100;
			var time_off = 150;
			jQuery( '.sidenavig li' ).hover( function() {
				jQuery( this ).animate( { marginLeft: '30px' }, time_on );
			}, function() {
				jQuery( this ).animate( { marginLeft: '15px' }, time_off );
			} );
			
		} );
		// nivo slider settings
		<?php if( $useslider == 'yes' && ( is_home() || is_page_template( 'index_full_products.php' ) || is_page_template( 'index_narrow_scrolled.php' ) || is_page_template( 'index_narrow_grided.php' ) || is_page_template( 'index_common_blog.php' ) ) ) { ?>
		
		<?php if( $sli_ty == 'jq' ) { ?>
		
		jQuery( window ).load( function() {
			jQuery( '#slider' ).nivoSlider( {
				effect: "<?php echo $sseff; ?>", // Specify sets like: 'fold,fade,sliceDown'
				slices: <?php echo $ssslices; ?>, // For slice animations
				boxCols: <?php echo $ssboxCols; ?>, // For box animations
				boxRows: <?php echo $ssboxRows; ?>, // For box animations
				animSpeed: <?php echo $ssanimSpeed * 1000; ?>, // Slide transition speed
				pauseTime: <?php echo $sstiming * 1000; ?>, // How long each slide will show
				startSlide: 0, // Set starting Slide (0 index)
				directionNav: true, // Next & Prev navigation
				directionNavHide: true, // Only show on hover
				controlNav: true, // 1,2,3... navigation
				controlNavThumbs: false, // Use thumbnails for Control Nav
				controlNavThumbsFromRel: false, // Use image rel for thumbs
				controlNavThumbsSearch: '.jpg', // Replace this with...
				controlNavThumbsReplace: '_thumb.jpg', // ...this in thumb Image src
				keyboardNav: true, // Use left & right arrows
				pauseOnHover: true, // Stop animation while hovering
				manualAdvance: <?php if( $ssmode == 'manual' ) echo 'true'; elseif( $ssmode == 'auto' ) echo 'false'; ?>, // Force manual transitions
				captionOpacity: 0.8, // Universal caption opacity
				prevText: "<?php echo $ssprevText; ?>", // Prev directionNav text
				nextText: "<?php echo $ssnextText; ?>", // Next directionNav text
				beforeChange: function(){}, // Triggers before a slide transition
				afterChange: function(){}, // Triggers after a slide transition
				slideshowEnd: function(){}, // Triggers after all slides have been shown
				lastSlide: function(){}, // Triggers when last slide is shown
				afterLoad: function(){} // Triggers when slider has loaded
			} );
		} );
		
		<?php } elseif( $sli_ty == 'pm' ) { ?>
		
				var flashvars = {};
				flashvars.cssSource = "<?php echo( get_template_directory_uri() . '/script/piecemaker/piecemaker.css' ); ?>";
				flashvars.xmlSource = "<?php echo( get_template_directory_uri() . '/script/piecemaker/piecemaker.php' ); ?>";
				
				var params = {};
				params.play = "true";
				params.menu = "false";
				params.scale = "showall";
				params.wmode = "transparent";
				params.allowfullscreen = "true";
				params.allowscriptaccess = "always";
				params.allownetworking = "all";
				
				swfobject.embedSWF( "<?php echo( get_template_directory_uri() . '/script/piecemaker/piecemaker.swf' ); ?>", 'flash', '930', '350', '10', null, flashvars, params, null );
		
		<?php } ?>
		
		<?php } ?>
		
    </script>
    
    <script src="<?php echo( get_template_directory_uri() . '/script/jquery.suppastore.custom.js' ); ?>" type="text/javascript"></script>
    
	<link rel="alternate" type="application/rss+xml" title="<?php bloginfo( 'name' ); ?> RSS Feed" href="<?php bloginfo( 'rss2_url' ); ?>" />
	<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
    <link rel="shortcut icon" href="<?php echo( get_template_directory_uri() . '/images/favicon.ico' ); ?>" type="image/x-icon" />
    
	<?php 
	// nested comments
	if( is_single() && get_option( 'thread_comments' ) ) wp_enqueue_script( 'comment-reply' );
	// support for Header
	function header_style() {};
	// header hook
	wp_head(); 
	?>
    
    <?php 
	// must be done AFTER colorbox plugin is loaded
    if( isset( $_GET[ "dc" ] ) && !empty( $_GET[ "dc" ] ) ) { 
        $dc = stripslashes( strip_tags( $_GET[ "dc" ] ) );
        if( $dc == 'pp' ) {
    ?>
    <script type="text/javascript">
		jQuery( document ).ready( function() {
        	jQuery.colorbox( { href: "<?php echo get_template_directory_uri() . '/thanx.php'; ?>", width: "<?php echo $cb_width . 'px'; ?>", height: "<?php echo $cb_height_small . 'px'; ?>", iframe: true } );
		} );
	</script>
    <?php 
        }
    } 
    ?>
</head>

<!-- head end -->

<body <?php body_class(); ?>>

<!-- main wrap start -->

<div id="maincontainer">

<!-- logo, admin pages and basket link start -->

<div class="container_12 prewrap relativ clearfix">
    
    	<!-- logo start -->
    
        <div id="logo" class="absolut">
        	<?php
			$hp_link = '';
			if( $hp_layout == 'narrow_grided' ) $hp_link = get_permalink( intval( get_option( 'welcomenarrowgrid' ) ) );
			elseif( $hp_layout == 'narrow_scrolled' ) $hp_link = get_permalink( intval( get_option( 'welcomenarrow' ) ) );
			elseif( $hp_layout == 'wide' ) $hp_link = get_permalink( intval( get_option( 'welcomefull' ) ) );
			elseif( $hp_layout == 'blog' ) $hp_link = get_permalink( intval( get_option( 'commonblog' ) ) );
			else $hp_link = home_url();
			?>
        	<a href="<?php echo $hp_link; ?>" title="<?php _e( "Home Page", "sofa_suppastore" ); ?>">
                <img src="<?php header_image(); ?>" alt="<?php _e( "Home Page", "sofa_suppastore" ); ?>" title="<?php bloginfo( 'name' ); ?>" />
            </a>
        </div>
        
        <!-- logo end -->
        
        <?php 
		global $current_user;
		get_currentuserinfo();
		if( current_user_can( 'administrator' ) ) {
		?>
        
        <!-- admin pages (stock inventory management and orders tracking) start -->
        
        <div id="adminlinks" class="push_4 absolut">
        	<?php if( $use_stock == 'yes' ) { ?>
        	<a href="<?php echo get_permalink( intval( get_option( 'stockinventory' ) ) ); ?>" title="<?php _e( "Stock Inventory", "sofa_suppastore" ); ?>">
            	<span class="maintain">&bull; <?php _e( "Stock Inventory", "sofa_suppastore" ); ?></span>
            </a>
            <?php } ?>
            <a href="<?php echo get_permalink( intval( get_option( 'ordersoverview' ) ) ); ?>" title="<?php _e( "Orders Overview", "sofa_suppastore" ); ?>">
            	<span class="maintain">&bull; <?php _e( "Orders Overview", "sofa_suppastore" ); ?></span>
            </a>
        </div>
        
        <!-- admin pages (stock inventory management and orders tracking) end -->
        
        <?php } ?>
        
        <!-- basket link start -->

        <div id="minibasket" class="absolut">
            <p id="basketinfo">
            	<?php
				$basket_price_total = 0;
				if( isset( $_COOKIE[ 'sofasuppastore' ] ) ) {
					foreach( $_COOKIE[ 'sofasuppastore' ] as $name => $value ) {
						$items_arr = explode( '~', $value );
						$item_price_total = $items_arr[ 2 ] * $items_arr[ 3 ];
						$basket_price_total = $basket_price_total + $item_price_total;
					}
				}
				$basket_count_items = 0;
				if( isset( $_COOKIE[ 'sofasuppastore' ] ) ) $basket_count_items = count( $_COOKIE[ 'sofasuppastore' ] );
				$final_str_items = ( $basket_count_items == 1 ) ? __( "item", "sofa_suppastore" ) : __( "items", "sofa_suppastore" );
				echo '<a id="mb" href="' . get_permalink( intval( get_option( 'checkout' ) ) ) . '">';
				echo __( "Your Basket", "sofa_suppastore" ) . ': ' . $entrycurrency . ' ' . number_format( $basket_price_total, 2, '.', ',' ) . ' (' . $basket_count_items . ' ' . $final_str_items . ')';
				echo '</a>';
				?>
            </p>
        </div>
        
        <!-- basket link end -->
        
</div>

<!-- logo, admin pages and basket link end -->

<div id="mainnaviwrap">

	<!-- main navigation start -->
    
	<?php if( has_nav_menu( 'main-menu' ) ) {

        $menu_defaults = array(
          'menu'            => 'main-menu', 
          'container'       => 'div', 
          'container_class' => 'dropmenu upper', 
          'container_id'    => 'globalnavi', 
          'menu_class'      => 'navigation', 
          'menu_id'         => 'dropmenu',
          'echo'            => true,
          'fallback_cb'     => '',
          'before'          => '',
          'after'           => '',
          'link_before'     => '',
          'link_after'      => '',
          'depth'           => 0,
          'walker'          => '',
          'theme_location'  => '' );
         
        wp_nav_menu( $menu_defaults );

    } ?>
    
    <!-- main navigation end -->
    
</div>

<!-- Sliders start -->

<?php if( $useslider == 'yes' && ( is_home() || is_page_template( 'index_full_products.php' ) || is_page_template( 'index_narrow_scrolled.php' ) || is_page_template( 'index_narrow_grided.php' ) || is_page_template( 'index_common_blog.php' ) ) ) { ?>

<div id="sliderouterwrap">

	<div id="lighter">
    
    <div id="sliderwrap">
    
    <?php if( $sli_ty == 'jq' ) { ?>
    
        <div id="slider">
        
            <?php
            // query nivo-slides custom post type
            $slide_args = array(
                'post_type' => array( 'nivo-slide' ),
                'posts_per_page' => -1,
                'post_status' => 'published',
                'nopaging' => 'true',
                'orderby' => 'title',
                'order' => 'ASC'
            );
            // build WP query
            $slide_query = new WP_Query( $slide_args );
            ?>
            
            <?php if( $slide_query->have_posts() ) : while ( $slide_query->have_posts() ) : $slide_query->the_post(); ?>
            
            <?php
            // extract image
            if( has_post_thumbnail( $post->ID ) ) {
                $att_args = array( 'post_type' => 'attachment', 'numberposts' => 1, 'post_status' => 'published', 'post_parent' => $post->ID );
                $all_attachments = get_posts( $att_args );
                $slide_link = get_post_meta( $all_attachments[ 0 ]->ID, '_url', true );
                $default_attr = array( 'class' => "alignleft" );
                $full_slide_path = get_the_post_thumbnail( get_the_ID(), 'full', $default_attr );
				$slide_img_path = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID() ), 'full' );
                $thumb_slide_path = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID() ), 'miniature' );
				$caption_text = get_post_meta( $post->ID, 'caption_text', true );
                // strip titles?
                $full_slide_path = preg_replace( '|(title=[\'"](.*?)[\'"])|i', '', $full_slide_path );
                // if( $slide_link != '' ) echo '<a href="' . $slide_link . '"><img src="' . $slide_img_path[ 0 ] . '" rel="' . $thumb_slide_path[ 0 ] . '" /></a>';
				if( $slide_link != '' ) echo '<a href="' . $slide_link . '"><img src="' . $slide_img_path[ 0 ] . '" title="' . $caption_text . '" /></a>';
				// else echo '<img src="' . $slide_img_path[ 0 ] . '" rel="' . $thumb_slide_path[ 0 ] . '" />';
                else echo '<img src="' . $slide_img_path[ 0 ] . '" title="' . $caption_text . '" />';
            }
            ?>
            
            <?php 
            endwhile; 
            else :
            ?>
            
            <p><?php _e( "No images found for Nivo slider!", "sofa_suppastore" ); ?></p>
            
            <?php
            endif; 
            ?>
            
        </div>
        
        <div class="nivo-directionNav" style="display: none;">
            <a href="#" class="nivo-prevNav"><?php _e( "Previous", "sofa_suppastore" ); ?></a>
            <a href="#" class="nivo-nextNav"><?php _e( "Next", "sofa_suppastore" ); ?></a>
        </div>
        
    <?php } elseif( $sli_ty == 'pm' ) { ?>
    
    	<div id="flash"><p><?php _e( "Flash Player not found!", "sofa_suppastore" ); ?></p></div>
    
    <?php } elseif( $sli_ty == 'st' ) { ?>
    
        <div id="static">
        
            <?php
            // query nivo-slides custom post type
            $slide_args = array(
                'post_type' => array( 'nivo-slide' ),
                'posts_per_page' => 1,
                'post_status' => 'published',
                'orderby' => 'title',
                'order' => 'ASC'
            );
            // build WP query
            $slide_query = new WP_Query( $slide_args );
            ?>
            
            <?php if( $slide_query->have_posts() ) : while ( $slide_query->have_posts() ) : $slide_query->the_post(); ?>
            
            <?php
            // extract image
            if( has_post_thumbnail( $post->ID ) ) {
                $att_args = array( 'post_type' => 'attachment', 'numberposts' => 1, 'post_status' => 'published', 'post_parent' => $post->ID );
                $all_attachments = get_posts( $att_args );
                $slide_link = get_post_meta( $all_attachments[ 0 ]->ID, '_url', true );
                $default_attr = array( 'class' => "alignleft" );
                $full_slide_path = get_the_post_thumbnail( get_the_ID(), 'full', $default_attr );
				$slide_img_path = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID() ), 'full' );
                // if( $slide_link != '' ) echo '<a href="' . $slide_link . '"><img src="' . $slide_img_path[ 0 ] . '" rel="' . $thumb_slide_path[ 0 ] . '" /></a>';
				if( $slide_link != '' ) echo '<a href="' . $slide_link . '"><img src="' . $slide_img_path[ 0 ] . '" /></a>';
				// else echo '<img src="' . $slide_img_path[ 0 ] . '" rel="' . $thumb_slide_path[ 0 ] . '" />';
                else echo '<img src="' . $slide_img_path[ 0 ] . '" />';
            }
            ?>
            
            <?php 
            endwhile; 
            else :
            ?>
            
            <p><?php _e( "No images found for Nivo slider!", "sofa_suppastore" ); ?></p>
            
            <?php
            endif; 
            ?>
            
        </div>
    
    <?php } ?>
    
    </div>
    
    </div>
    
</div>
    
<?php } ?>

<!-- sliders end -->

<?php 
// display extra content on index page. it can be found below Nivo slider and above all other content
	$use_extra_tb = $aOptions[ 'use_extra_tb' ];
	$extra_tb_title = ( strlen( $aOptions[ 'extra_tb_title' ] ) > 0 ) ? stripslashes( strip_tags( $aOptions[ 'extra_tb_title' ] ) ) : '';
	$extra_tb_text = ( strlen( $aOptions[ 'extra_tb_text' ] ) > 0 ) ? stripslashes( $aOptions[ 'extra_tb_text' ] ) : 'This is an extra text block. It can be easily added from theme Options page, Home Page Layout section. Feel free to format this chunk of text on the way you like!';
if( $use_extra_tb == 'yes' && ( is_home() || is_page_template( 'index_full_products.php' ) || is_page_template( 'index_narrow_scrolled.php' ) || is_page_template( 'index_narrow_grided.php' ) || is_page_template( 'index_common_blog.php' ) ) ) {
	echo '<div id="extratextwrap"><div id="extratext">';
	if( $use_extra_tb != '' ) { 
		if( $extra_tb_title != '' ) echo '<h2>' . $extra_tb_title . '</h2>';
	} 
	echo do_shortcode( wpautop( $extra_tb_text ) );
	echo '</div></div>';
}
?>

<div id="header" class="container_12 clearfix">
    
    <!-- breadcrumbs start -->
    
    <?php if( !is_home() && !is_page_template( 'index_full_products.php' ) && !is_page_template( 'index_narrow_scrolled.php' ) && !is_page_template( 'index_narrow_grided.php' )  && !is_page_template( 'index_common_blog.php' ) && $usebread == 'yes' && function_exists( 'dimox_breadcrumbs' ) ) { dimox_breadcrumbs(); } ?>
    
    <!-- breadcrumbs end -->
    
    <!-- header widgets start -->
    
    <?php if( is_home() || is_page_template( 'index_full_products.php' ) || is_page_template( 'index_narrow_scrolled.php' ) || is_page_template( 'index_narrow_grided.php' )  || is_page_template( 'index_common_blog.php' ) ) { ?>
    
    <div id="headerwidgets" class="container_12 clearfix">
    
        <div id="headerLeft" class="grid_3">
            <?php if ( !function_exists( 'dynamic_sidebar' ) || !dynamic_sidebar( 'Header Left' ) ) : ?>
            &nbsp;
            <?php endif; ?>
        </div>
        
        <div id="headerCenterLeft" class="grid_3">
            <?php if ( !function_exists( 'dynamic_sidebar' ) || !dynamic_sidebar( 'Header Center Left' ) ) : ?>
            &nbsp;
            <?php endif; ?>
        </div>
        
        <div id="headerCenterRight" class="grid_3">
            <?php if ( !function_exists( 'dynamic_sidebar' ) || !dynamic_sidebar( 'Header Center Right' ) ) : ?>
            &nbsp;
            <?php endif; ?>
        </div>
        
        <div id="headerRight" class="grid_3">
            <?php if ( !function_exists( 'dynamic_sidebar' ) || !dynamic_sidebar( 'Header Right' ) ) : ?>
            &nbsp;
            <?php endif; ?>
        </div>
    
    </div>
    
    <?php } ?>
    
    <!-- header widgets end -->

</div>

<!-- body wrapper start (it helps page footer stick to the bottom of a screen) -->

<div id="content" class="container_12 clearfix">